package com.bringway.global.constant;

import java.io.IOException;
import java.util.Properties;
/*
* @author 作者 xuef
* @version 创建时间：2015年9月11日 下午4:28:07
* 类说明
*/
public class FMConstant {
	
	private static FMConstant reader;
	
	//ftp
	private static String ftpHost;
	
	private static String ftpPort;
	
	private static String ftpUserName;
	
	private static String ftpPassWord;
	
	private static String ftpRoot;
	
	private FMConstant() {
		
	}
	
	public static FMConstant getInstance() throws IOException {
		if (reader == null) {
			reader = new FMConstant();
		}
		return reader;
	}

	public void reload(Properties prop) throws IOException {
		FMConstant.read(prop);
	}
	
	public static void read(Properties prop) throws IOException {
		ftpHost = prop.getProperty("ftp.host");
		ftpPort = prop.getProperty("ftp.port");
		ftpUserName = prop.getProperty("ftp.username");
		ftpPassWord = prop.getProperty("ftp.password");
		ftpRoot = prop.getProperty("ftp.root");
	}

	public static FMConstant getReader() {
		return reader;
	}

	public static void setReader(FMConstant reader) {
		FMConstant.reader = reader;
	}

	public static String getFtpHost() {
		return ftpHost;
	}

	public static void setFtpHost(String ftpHost) {
		FMConstant.ftpHost = ftpHost;
	}

	public static String getFtpPort() {
		return ftpPort;
	}

	public static void setFtpPort(String ftpPort) {
		FMConstant.ftpPort = ftpPort;
	}

	public static String getFtpUserName() {
		return ftpUserName;
	}

	public static void setFtpUserName(String ftpUserName) {
		FMConstant.ftpUserName = ftpUserName;
	}

	public static String getFtpPassWord() {
		return ftpPassWord;
	}

	public static void setFtpPassWord(String ftpPassWord) {
		FMConstant.ftpPassWord = ftpPassWord;
	}

	public static String getFtpRoot() {
		return ftpRoot;
	}

	public static void setFtpRoot(String ftpRoot) {
		FMConstant.ftpRoot = ftpRoot;
	}
	
	
}
